package singleton.demo3;

/**
 * @auth 吴志勇
 * @date 2022/11/2 15:04
 */
public class YaFactory {

    private static  YaFactory yaFactory;

    private YaFactory() {
    }

    public static YaFactory getInstance(){
        if (yaFactory == null){
            yaFactory = Helper.FACTORY;
        }
        return yaFactory;
    }

    // 静态 内部类
    static class Helper{
        final static YaFactory FACTORY = new YaFactory();
    }

}
